notebook: return TRUE for drag-motion event when over tabs
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 20 Sep 2012 00:56:26 +0000 (20:56 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 22 Oct 2012 22:39:37 +0000 (18:39 -0400)
commit852d4d618c46238228220f6f311ea4e764c0e6d8
tree810998997831cb0a960c68744b8d92c4aaaa9fa2
parent42da600eb193e3423ab7810380ae39bac95d47fd
notebook: return TRUE for drag-motion event when over tabs

The GtkNotebook drag-motion event handler may install a timeout when
hovering over a tab, in order to switch to it.
On the other hand it's desirable for applications to use the empty tab
area as a drop target, so the drag-motion handler returns FALSE
(also in case it installs the switch tab timeout), as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=350665.

Unfortunately, applications can use the tab label widget (or a child
of it) as a different drop target area, and install their own
drag-motion handler there.
In this scenario, the timeout will still be installed by GtkNotebook's
handler, but since it returns FALSE, it will never get the matching
drag-leave event, causing it to trigger also when the mouse pointer
moved elsewhere before it expired.

Fix this by returning TRUE from drag-motion when the event is over a
tab. Note that this makes automatic tab switching not work anymore when
drag and drop is handled in the tab label widget; applications are
expected to also handle tab switching if desired in such a case.

https://bugzilla.gnome.org/show_bug.cgi?id=684415
gtk/gtknotebook.c